package com.homedo.microservice.open.service.gateway.manager.web.gateway.bean.po.enhanced;

import com.homedo.common.dao.bean.po.enhanced.base.BaseEnhanced;
import com.homedo.microservice.open.service.gateway.manager.web.gateway.bean.enums.foralertnotice.StatusEnum4AlertNotice;
import com.homedo.microservice.open.service.gateway.manager.web.gateway.bean.po.AlertNotice;
import org.springframework.beans.BeanUtils;

import java.util.Date;

/**
 * @author 作者 jgshun
 * @date 创建时间 2018年10月16日 16时44分30秒
 */
public class AlertNoticeEnhanced extends BaseEnhanced {

    public AlertNoticeEnhanced(AlertNotice alertNotice) {

        BeanUtils.copyProperties(alertNotice, this);

        //自动生成 细微误差自己调整

        if (alertNotice.getAlertingId() != null) {
            AlertingEnhanced alertingEnhanced = new AlertingEnhanced();
            alertingEnhanced.setId(alertNotice.getAlertingId());
            this.alertingEnhanced = alertingEnhanced;
        }
        if (alertNotice.getAlertUserId() != null) {
            AlertUserEnhanced alertUserEnhanced = new AlertUserEnhanced();
            alertUserEnhanced.setId(alertNotice.getAlertUserId());
            this.alertUserEnhanced = alertUserEnhanced;
        }
        if (alertNotice.getStatus() != null) {
            this.status = StatusEnum4AlertNotice
                    .getStatusEnumByCode(alertNotice.getStatus().shortValue());
        }
    }

    public AlertNoticeEnhanced() {
    }

    private Integer id;
    private AlertingEnhanced alertingEnhanced;
    private AlertUserEnhanced alertUserEnhanced;
    private Integer noticeTotal;
    private StatusEnum4AlertNotice status;
    private Integer noticeCount;
    private Date createTime;
    private Date updateTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public AlertingEnhanced getAlertingEnhanced() {
        return alertingEnhanced;
    }

    public void setAlertingEnhanced(AlertingEnhanced alertingEnhanced) {
        this.alertingEnhanced = alertingEnhanced;
    }

    public AlertUserEnhanced getAlertUserEnhanced() {
        return alertUserEnhanced;
    }

    public void setAlertUserEnhanced(AlertUserEnhanced alertUserEnhanced) {
        this.alertUserEnhanced = alertUserEnhanced;
    }

    public Integer getNoticeTotal() {
        return noticeTotal;
    }

    public void setNoticeTotal(Integer noticeTotal) {
        this.noticeTotal = noticeTotal;
    }

    public StatusEnum4AlertNotice getStatus() {
        return status;
    }

    public void setStatus(StatusEnum4AlertNotice status) {
        this.status = status;
    }

    public Integer getNoticeCount() {
        return noticeCount;
    }

    public void setNoticeCount(Integer noticeCount) {
        this.noticeCount = noticeCount;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }


}